package kr.saeildamil.androidstudy_second.br_service;

import java.util.Random;

import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
import android.util.Log;

public class LocalService extends Service{
	private final IBinder mBinder = new LocalBinder();
	private final Random mGen = new Random();
	
	class LocalBinder extends Binder{
		LocalService getService(){
			Log.d("BoundServiceTest", "getService()");
			return LocalService.this;
		}
	}
	@Override
	public IBinder onBind(Intent intent) {
		Log.d("BoundServiceTest", "onBind()");
		return null;
	}
	
	//Acitivy (클라이언트)가 호출하는 메소드
	public int getRandomnumber(){
		Log.d("BoundServiceTest", "getRandomnumber()");
		return mGen.nextInt();
	}
	
	@Override
	public void onCreate() {
		Log.d("BoundServiceTest", "onCreate()");
		super.onCreate();
	}
	
	@Override
	public void onDestroy() {
		Log.d("BoundServiceTest", "onDestroy()");
		super.onDestroy();
	}
	
}

	